﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="edit.aspx.cs" Inherits="sys_users_edit" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>编辑系统管理员</title>
    <link href="../../css/main.css" rel="stylesheet" type="text/css" />
    <link href="../style/StyleSheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div id="main">
        <div id="head">
        </div>
        <div id="content">
            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                CellPadding="2" DataSourceID="SqlDataSource1" ForeColor="Black" 
                GridLines="None" BackColor="LightGoldenrodYellow" BorderColor="Tan" 
                BorderWidth="1px" CssClass="tablewidth">
                <FooterStyle BackColor="Tan" />
                <Columns>
                    <asp:HyperLinkField DataNavigateUrlFields="username" 
                        DataNavigateUrlFormatString="~/sys/users/modipwd.aspx?un={0}" 
                        DataTextField="username" HeaderText="用户名" />
                    <asp:BoundField DataField="realname" HeaderText="真实姓名" 
                        SortExpression="realname" />
                    <asp:HyperLinkField DataNavigateUrlFields="username" 
                        DataNavigateUrlFormatString="~/sys/users/del.aspx?un={0}" HeaderText=" " 
                        Text="删除" />
                </Columns>
                <PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue" 
                    HorizontalAlign="Center" />
                <EmptyDataTemplate>
                    <table style="width:100%;">
                        <tr>
                            <td>
                                用户名</td>
                            <td>
                                真实姓名</td>
                            <td>
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td>
                                <asp:HyperLink ID="HyperLink1" runat="server" 
                                    NavigateUrl='<%# "../modipwd.aspx?un=" + Eval("username") %>' 
                                    Text='<%# Eval("username") %>'></asp:HyperLink>
                            </td>
                            <td>
                                <asp:Label ID="Label2" runat="server" Text='<%# Eval("realname") %>'></asp:Label>
                            </td>
                            <td>
                                <asp:HyperLink ID="HyperLink2" runat="server" 
                                    NavigateUrl='<%# "del.aspx?un=" + Eval("username") %>' Text="删除"></asp:HyperLink>
                            </td>
                        </tr>
                    </table>
                </EmptyDataTemplate>
                <SelectedRowStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" />
                <HeaderStyle BackColor="Tan" Font-Bold="True" />
                <AlternatingRowStyle BackColor="PaleGoldenrod" />
            </asp:GridView>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                ConnectionString="Data Source=(local)\sqlexpress;Initial Catalog=app;Integrated Security=True" 
                ProviderName="System.Data.SqlClient" 
                SelectCommand="SELECT users.username, users.realname FROM userrole INNER JOIN users ON userrole.userid = users.userid WHERE (userrole.roleid = 1) OR (userrole.roleid = 2)">
            </asp:SqlDataSource>
        </div>
    </div>
    </form>
</body>
</html>
